'use strict';

module.exports = app => {
  const { INTEGER, STRING, TEXT, DATE, NOW } = app.Sequelize;

  const Feedback = app.model.define('feedback', {
    id: { type: INTEGER, primaryKey: true, autoIncrement: true, unique: true },
    avatar: {
      type: STRING,
      defaultValue: 'https://qcms-upload.oss-cn-shanghai.aliyuncs.com/2020-01-11/1578730994708eix2p9qsovm.jpg',
    },
    username: {
      type: STRING,
      defaultValue: '匿名',
    },
    content: {
      type: TEXT,
      defaultValue: '',
    },
    create_at: {
      type: DATE,
      defaultValue: NOW,
    },
  }, {
    timestamps: false,
    tableName: 'l_feedback',
  });

  return Feedback;
}
